dic1 = {'name': 'tom', 'age': 20, 'gender': '男'}
dic2 = {}
dic3 = dict()
print(dic1)
print(type(dic1))
print(dic2)
print(dic3)

# 增加/修改
dic1['name'] = "刘传政"
dic1['money'] = 100
print(dic1)
# 查
print(dic1['name'])
print(dic1.get('name'))
print(dic1.get('names'))  # None
print(dic1.keys())
print(dic1.values())
print(dic1.items())
# 遍历
print('-'*20)
for i in dic1.keys():
    print(i)

for i in dic1.values():
    print(i)

for i in dic1.items():
    print(i)
for key,value in dic1.items():
    print(f'{key}={value}')
print('-'*20)
# 删除
del(dic1['name'])
print(dic1)
dic1.clear()
print(dic1)






